<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style type="text/css">
    .title {
      background-color: aquamarine;
    }
  </style>
  <body>
    <div id="app"></div>
    <div id="app1"></div>
    <script src="../js/babel.min.js"></script>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script type="text/babel">
      const vid = "demo";
      const text = "Hello React";
      // 创建虚拟DOM
      const VDOM = <h1>Hello React</h1>;
      const VDOM1 = (
        <div id={vid}>
          <div style={{ backgroundColor: "aquamarine" }}>this is div</div>
          <span className="title">{text.toUpperCase()}</span>
        </div>
      );
      // 将虚拟DOM进行渲染
      ReactDOM.render(VDOM, document.getElementById("app"));
      ReactDOM.render(VDOM1, document.getElementById("app1"));
    </script>
  </body>
</html>
